<?
class home_model extends CI_Model
{
	function __construct() 
	{
		parent::__construct();
	}
	
	function get_all($num=20,$start=0)
	{
		$this->db->where('bl_active',1) ;
		$query = $this->db->get('product', $num, $start) ;
		return $query->result() ;
	}
	
	function count_all()
	{
		$this->db->where('bl_active',1) ;
		$query = $this->db->get('product') ;
		return $query->num_rows() ;
	}
	
	function get_id($id)
	{
		$this->db->where('id',$id) ;
		$this->db->where('bl_active',1) ;
		$query = $this->db->get('product', $num, $start) ;
		return $query->row() ;
	}
}
?>